Repository navigation
Add Checker::cancelable - #1395
Merged
Merged
Conversation
clauderic
force-pushed
the
theme-check-cancelable
branch
from
November 12, 2026 21:45
066fcbb to
854eeef
Compare
agent-server checks themes on request, and wants to stop a run whose result nobody needs any more. `checker.cancelable(&f).run(&fs, root)` calls `f` before each file is read, parsed and checked, and before the theme graph is built. Once it returns true, the run returns an error whose `is_cancelled()` is true. `Checker::run` is a run that's never cancelled. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
clauderic
force-pushed
the
theme-check-cancelable
branch
from
November 12, 2026 21:46
854eeef to
5c72606
Compare
charlespwd
approved these changes
Nov 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What are you adding in this PR?
checker.cancelable(&f).run(&fs, root), a run that stops oncefreturns true, with an error whoseis_cancelled()is true. agent-server checks themes on request, and wants to stop a run whose result nobody needs anymore.fis called before each file is read, parsed and checked, and before the theme graph is built. It's called from the thread doing that work, so it'sFn() -> bool + Sync.freturns false again later.Checker::runisself.cancelable(&|| false).run(fs, root).ErrorwasError(String)with a private field, so it gains a cancelled flag without a breaking change.Not covered: listing the theme's files, and downloading the docs and schemas when they aren't given.
Stacked for agent-server, to merge in order:
Checker::ignoreChecker::threadsChecker::cancelable(this PR)Tophatting
Checker::cancelablecancels before the first file.a_run_cancelled_between_files_is_cancelledcancels after the first of two files is checked. It fails without the runner's check.cargo test --workspaceBefore you deploy
changeset.theme-check-rsis 0.1.x, where an addition is a patch bump (0.1.0 → 0.1.1).🤖 Generated with Claude Code